package com.coderdream.chapter14.chainofresponsibility.a4;

public class LimitSupport extends Support {
	private int limit;

	public LimitSupport(String name, int limit) {
		super(name);
		this.limit = limit;
	}

	/*
	 * 解决的方法 (non-Javadoc)
	 * 
	 * @see com.coderdream.chapter14.chainofresponsibility.sample.Support#resolve(com.coderdream.chapter14.chainofresponsibility.sample.Trouble)
	 */
	@Override
	protected boolean resolve(Trouble trouble) {
		if (trouble.getNumber() < limit) {
			return true;
		} else {
			return false;
		}
	}
}
